onNestedScroll

open fun onNestedScroll(@NonNull parent: ViewParent, @NonNull target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int)(source)

React to a nested scroll in progress.

This version of the method just calls onNestedScroll using the touch input type.

Parameters

parent

ViewParent that contains the target view.

target

The descendent view controlling the nested scroll

dxConsumed

Horizontal scroll distance in pixels already consumed by target

dyConsumed

Vertical scroll distance in pixels already consumed by target

dxUnconsumed

Horizontal scroll distance in pixels not consumed by target

dyUnconsumed

Vertical scroll distance in pixels not consumed by target


open fun onNestedScroll(@NonNull parent: ViewParent, @NonNull target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, type: Int)(source)

React to a nested scroll in progress.

This method will be called when the ViewParent's current nested scrolling child view dispatches a nested scroll event. To receive calls to this method the ViewParent must have previously returned true for a call to onStartNestedScroll.

Both the consumed and unconsumed portions of the scroll distance are reported to the ViewParent. An implementation may choose to use the consumed portion to match or chase scroll position of multiple child elements, for example. The unconsumed portion may be used to allow continuous dragging of multiple scrolling or draggable elements, such as scrolling a list within a vertical drawer where the drawer begins dragging once the edge of inner scrolling content is reached.

Parameters

parent

ViewParent that contains the target view.

target

The descendant view controlling the nested scroll

dxConsumed

Horizontal scroll distance in pixels already consumed by target

dyConsumed

Vertical scroll distance in pixels already consumed by target

dxUnconsumed

Horizontal scroll distance in pixels not consumed by target

dyUnconsumed

Vertical scroll distance in pixels not consumed by target

type

the type of input which cause this scroll event


open fun onNestedScroll(@NonNull parent: ViewParent, @NonNull target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, type: Int, @NonNull consumed: Array<Int>)(source)

React to a nested scroll in progress.

This method will be called when the ViewParent's current nested scrolling child view dispatches a nested scroll event. To receive calls to this method the ViewParent must have previously returned true for a call to onStartNestedScroll.

Both the consumed and unconsumed portions of the scroll distance are reported to the ViewParent. An implementation may choose to use the consumed portion to match or chase scroll position of multiple child elements, for example. The unconsumed portion may be used to allow continuous dragging of multiple scrolling or draggable elements, such as scrolling a list within a vertical drawer where the drawer begins dragging once the edge of inner scrolling content is reached.

Parameters

parent

ViewParent that contains the target view.

target

The descendent view controlling the nested scroll

dxConsumed

Horizontal scroll distance in pixels already consumed by target

dyConsumed

Vertical scroll distance in pixels already consumed by target

dxUnconsumed

Horizontal scroll distance in pixels not consumed by target

dyUnconsumed

Vertical scroll distance in pixels not consumed by target

type

the type of input which cause this scroll event

consumed

Output. If not null, upon this method returning, will contain the scroll distances consumed by this nested scrolling parent and the scroll distances consumed by any other parent up the view hierarchy.